﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
  <xsl:output method="xml" indent="no" />

  <xsl:template match="/">
    <xsl:apply-templates select="//div [@id = 'results']/ul/li [position() &lt; 6]" />
  </xsl:template>

  <xsl:template match="li">
    <xsl:variable name="anchor" select="./div/div [@class = 'sb_tlst']/h3/a" />
    <div>
      <div>
        <a>
          <xsl:attribute name="href">
            <xsl:value-of select="$anchor/@href" />
          </xsl:attribute>
          <xsl:copy-of select="$anchor/node()" />
        </a>
      </div>
      <div>
        <xsl:copy-of select="./div/p" />
      </div>
    </div>
  </xsl:template>
</xsl:stylesheet>


